package com.cazor.dg.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cazor.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.cazor.dg.mapper.DgParamDataSensorMapper;
import com.cazor.dg.domain.DgParamDataSensor;
import com.cazor.dg.service.IDgParamDataSensorService;

/**
 * 传感器数据传输记录Service业务层处理
 * 
 * @author cazor
 * @date 2023-11-27
 */
@Service
public class DgParamDataSensorServiceImpl extends ServiceImpl<DgParamDataSensorMapper, DgParamDataSensor> implements IDgParamDataSensorService
{
    @Resource
    private DgParamDataSensorMapper dgParamDataSensorMapper;

    /**
     * 查询传感器数据传输记录
     * 
     * @param id 传感器数据传输记录主键
     * @return 传感器数据传输记录
     */
    @Override
    public DgParamDataSensor selectDgParamDataSensorById(Long id)
    {
        return dgParamDataSensorMapper.selectDgParamDataSensorById(id);
    }

    /**
     * 查询传感器数据传输记录列表
     * 
     * @param dgParamDataSensor 传感器数据传输记录
     * @return 传感器数据传输记录
     */
    @Override
    public List<DgParamDataSensor> selectDgParamDataSensorList(DgParamDataSensor dgParamDataSensor)
    {
        return dgParamDataSensorMapper.selectDgParamDataSensorList(dgParamDataSensor);
    }


    /**
     * 关联数据表 dg_device_sensor(status=1 and valid='1')
     * @param dgParamDataSensor 查询条件
     * @return 列表
     */
    public List<DgParamDataSensor> getDgParamDataSensorList(DgParamDataSensor dgParamDataSensor) {
        return dgParamDataSensorMapper.getDgParamDataSensorList(dgParamDataSensor);
    }

    /**
     * 新增传感器数据传输记录
     * 
     * @param dgParamDataSensor 传感器数据传输记录
     * @return 结果
     */
    @Override
    public int insertDgParamDataSensor(DgParamDataSensor dgParamDataSensor)
    {
        dgParamDataSensor.setCreateTime(DateUtils.getNowDate());
        return dgParamDataSensorMapper.insertDgParamDataSensor(dgParamDataSensor);
    }

    /**
     * 修改传感器数据传输记录
     * 
     * @param dgParamDataSensor 传感器数据传输记录
     * @return 结果
     */
    @Override
    public int updateDgParamDataSensor(DgParamDataSensor dgParamDataSensor)
    {
        dgParamDataSensor.setUpdateTime(DateUtils.getNowDate());
        return dgParamDataSensorMapper.updateDgParamDataSensor(dgParamDataSensor);
    }

    /**
     * 批量删除传感器数据传输记录
     * 
     * @param ids 需要删除的传感器数据传输记录主键
     * @return 结果
     */
    @Override
    public int deleteDgParamDataSensorByIds(Long[] ids)
    {
        return dgParamDataSensorMapper.deleteDgParamDataSensorByIds(ids);
    }

    /**
     * 删除传感器数据传输记录信息
     * 
     * @param id 传感器数据传输记录主键
     * @return 结果
     */
    @Override
    public int deleteDgParamDataSensorById(Long id)
    {
        return dgParamDataSensorMapper.deleteDgParamDataSensorById(id);
    }
}
